package com.yoooya.base.third.utils.json.cp;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yoooya.base.third.common.error.WxError;
import com.yoooya.base.third.model.vo.cp.WxCpDepart;
import com.yoooya.base.third.model.vo.cp.WxCpMessage;
import com.yoooya.base.third.model.vo.cp.WxCpTag;
import com.yoooya.base.third.model.vo.cp.WxCpUser;

/**
 * 
 * @创建人 Sun Yijing
 * @创建时间 2018-07-08
 */
public class WxCpGsonBuilder {

	public static final GsonBuilder INSTANCE = new GsonBuilder();

	static {
		INSTANCE.disableHtmlEscaping();
		INSTANCE.registerTypeAdapter(WxCpMessage.class,
				new WxCpMessageGsonAdapter());
		INSTANCE.registerTypeAdapter(WxCpDepart.class,
				new WxCpDepartGsonAdapter());
		INSTANCE.registerTypeAdapter(WxCpUser.class, new WxCpUserGsonAdapter());
		INSTANCE.registerTypeAdapter(WxError.class, new WxErrorAdapter());
		INSTANCE.registerTypeAdapter(WxCpTag.class, new WxCpTagGsonAdapter());
	}

	public static Gson create() {
		return INSTANCE.create();
	}

}
